﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO_QLNS;

namespace ADO_QLNS
{
    public class OrderADO : QLNS_ADO
    {
        OrderDTO _DTO;
        public override string InsertString(TransferObject dto)
        {
            _DTO = (OrderDTO)dto;
            string insertCmd = "INSERT INTO Order(CustomerID, TotalPrice, Status) VALUES({0},{1},{2})";
            return String.Format(insertCmd, _DTO.CustomerID, _DTO.TotalPrice, _DTO.Status);
        }

        public override string UpdateString(TransferObject dto)
        {
            _DTO = (OrderDTO)dto;
            string updateCmd = "Update Order SET TotalPrice = {0} WHERE OrderID = {1})";
            return String.Format(updateCmd, _DTO.TotalPrice, _DTO.OrderID);
        }

        public override string DeleteString(TransferObject dto)
        {
            throw new NotImplementedException();
        }

        protected override object GetDataFromDataRow(System.Data.DataTable dt, int i)
        {
            throw new NotImplementedException();
        }
    }
}
